package com.df.agent.track;

public class TrackContext {
    private static final ThreadLocal<String> trackLocal = new ThreadLocal<String>();
    private static final ThreadLocal<Integer> trackDeep = new ThreadLocal<Integer>();
    private static final ThreadLocal<Integer> functionId = new ThreadLocal<Integer>();
    public static Integer getFunctionId(){
        return functionId.get();
    }
    public static void setFunctionId(Integer fId){
        functionId.set(fId);
    }

    public static Integer getTrackDeep(){
        return trackDeep.get();
    }
    public static void setTrackDeep(Integer deep){
        trackDeep.set(deep);
    }
    public static void setTrackDeepAdd(){
        trackDeep.set(trackDeep.get()+1);
    }
    public static void clear(){
        trackLocal.remove();
    }
    public static String getLinkId(){
        return trackLocal.get();
    }
    public static void setLinkId(String linkId){
        trackLocal.set(linkId);
    }

}
